package com.yunshipei.model;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;

import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class UserInfo implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = 2137858447754291077L;
    @SerializedName("uuid")
    private String uuid = "";
    @SerializedName("name")
    private String name = "";
    @SerializedName("password")
    private String password = "";
    @SerializedName("department")
    private String department = "";
    @SerializedName("departmentId")
    private String departmentId = "";
    @SerializedName("companyId")
    private String companyId = "";
    @SerializedName("position")
    private String position = "";
    @SerializedName("tel")
    private String tel = "";
    @SerializedName("email")
    private String email = "";
    @SerializedName("createdTime")
    private String createdTime = "";
    @SerializedName("avatar")
    private String avatar = "";
    @SerializedName("isAdmin")
    private String isAdmin = "";
    @SerializedName("common")
    private List<String> common = new ArrayList<>();
    /**
     * 当SelecteState == false时,默认在friendListActivity中用户可以被选中也可以取消
     * selectState == true时,默认在friendListActivity中用户不可以取消选中状态
     */
    private boolean selecteState;

    public void setCommon(List<String> common) {
        this.common = common;
    }

    public void setSelecteState(boolean selecteState) {
        this.selecteState = selecteState;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(String isAdmin) {
        this.isAdmin = isAdmin;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public List<String> getCommon() {
        return common;
    }

    public boolean isSelecteState() {
        return selecteState;
    }

    private String string = "";

    public String toString() {
        if (TextUtils.isEmpty(string)) {
            try {
                JSONObject object = new JSONObject();
                object.put("uuid", uuid);
                object.put("name", name);
                object.put("department", department);
                object.put("position", position);
                object.put("companyId", companyId);
                object.put("departmentId", departmentId);
                object.put("phoneNumber", tel);
                object.put("email", email);
                object.put("createdTime", createdTime);
                object.put("avatar", avatar);
                string = object.toString();
                return string;
            } catch (Exception e) {

            }
        }
        return string;
    }
}
